package com.example.mybatis20231228.mapper;

import com.example.mybatis20231228.demos.web.User;
import com.example.mybatis20231228.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserInfoMapper {
    @Select("select * from userinfo where id=${id}")
    public UserInfo selectById(Integer id);

    @Select("select * from userinfo where username=#{username}")
    public List<UserInfo> selectByName(String username);

    @Select("select * from userinfo order by id ${sort}")
    public List<UserInfo> selectBySort(String sort);

    @Select("select * from userinfo where username like concat('%',#{like},'%')")
    public List<UserInfo> selectByLike(String like);
}
